package com.kt.kvw.model.respone;

import com.kt.kvw.enums.ResultCodeEnum;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * Desc:
 *
 * @author: keen
 * Date: 2020-07-04
 * Time: 23:14
 */
@Data
public class ResponseData<T> {
    private boolean success;
    private int code;
    private String message;
    private T detail;

    public ResponseData(ResultCodeEnum resultCode) {
        this(resultCode.success(), resultCode.getCode(), resultCode.getMessage());
    }

    public ResponseData(boolean success, int code, String message) {
        this(success, code, message, null);
    }

    public ResponseData(boolean success, int code, String message, T detail) {
        this.success = success;
        this.code = code;
        this.message = message;
        this.detail = detail;
    }

}
